package com.retail.booking.controller;

import com.retail.booking.client.BookingXiaohesuanClient;
import com.retail.booking.entity.BookingXiaohesuanSaveRequest;
import com.retail.core.entity.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gaoya
 */
@Api(value = "小核酸预约API", tags = "小核酸预约API")
@RestController
@RequestMapping("api/bookingxiaohesuan")
public class BookingXiaohesuanApiController {

    private final BookingXiaohesuanClient bookingXiaohesuanClient;

    public BookingXiaohesuanApiController(BookingXiaohesuanClient bookingXiaohesuanClient) {
        this.bookingXiaohesuanClient = bookingXiaohesuanClient;
    }

    /**
     * 保存小核算记录
     * @param request
     * @return
     */
    @ApiOperation("小核算预约记录")
    @PostMapping("saveXiaohesuan")
    public Result saveXiaohesuan(@RequestBody BookingXiaohesuanSaveRequest request) {
        return bookingXiaohesuanClient.saveXiaohesuan(request);
    }

    /**
     * 查询小核酸预约信息
     * @param request
     * @return
     */
    @ApiOperation("查询小核酸预约信息")
    @PostMapping("findXiaohesuan")
    public Result findXiaohesuan(@RequestBody BookingXiaohesuanSaveRequest request) {
        return bookingXiaohesuanClient.findXiaohesuan(request);
    }

}

